<?php #Карта сайта
/*DEE_DESC
 $templ['title']='Карта сайта';
//DEE_DESC_END*/
$filter=array('_sitemap','_simple',);
$list=array();

	$conn->query("select url,if(h1='',title,h1)as title,id from pages where parents='' and templ not in('".implode('\',\'',$filter).'\') and dateFrom<now() and dateTo>now()  and zin>0 order by zin,title',false,1);
	$view->gText.='<ul class="sitemap">';
	while($row=$conn->fetch(1))
	{
		$view->gText.='<li><a href="/'.$row['url'].'">'.$row['title'].'</a>';
		$conn->query("select title,url from pages where parents='#{$row['id']}#' and templ not in('".implode('\',\'',$filter).'\') and dateFrom<now() and dateTo>now()  and zin>0  order  by zin,title');
		if($conn->rowCount())
		{
			$view->gText.='<ul class="depth-2">';
			while($row2=$conn->fetch())
					$view->gText.='<li><a href="/'.$row['url'].'/'.$row2['url'].'">'.$row2['title'].'</a></li>';
			$view->gText.='</ul>';
		}
	$view->gText.='</li>';
	}
$view->gText.='</ul>';

